/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; /* 使用更现代的字体栈 */
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f9; /* 浅灰色背景，干净整洁 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #007bff; /* 蓝色链接 */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #0056b3;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: #343a40; /* 深色标题 */
    margin-bottom: 0.75em;
    font-weight: 600; /* 加粗标题 */
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; } /* 间距类 */
.mb-3 { margin-bottom: 1rem; }
.p-4 { padding: 1.5rem; }

/* Layout Styles (for sidebar) */
.left-sidebar {
    width: 220px; /* 调整左侧导航栏宽度 */
    background-color: #2c3e50; /* 更深的蓝色调，与截图接近 */
    color: #ecf0f1; /* 浅色文字 */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    padding-top: 20px; /* 顶部内边距 */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* 更明显的阴影 */
    z-index: 1000;
    overflow-y: auto;
    display: flex; /* 使用 flex 布局 */
    flex-direction: column; /* 垂直排列 */
}

.sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #34495e; /* 分隔线 */
    margin-bottom: 10px;
}

.sidebar-header .logo-container {
    /* 如果有Logo图片，可以调整样式 */
}

.sidebar-header h3 {
    color: #ecf0f1; /* 标题颜色 */
    margin: 0;
    font-size: 1.6em; /* 标题字体大小 */
    font-weight: 700; /* 更粗的标题 */
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* 让菜单列表占据剩余空间 */
}

.sidebar-menu li {
    border-bottom: 1px solid #34495e; /* 菜单项之间的分隔线 */
}

.sidebar-menu li:last-child {
    border-bottom: none; /* 最后一个菜单项没有底边框 */
}

.sidebar-menu a {
    display: flex; /* 使用 flex 布局，方便图标和文字对齐 */
    align-items: center; /* 垂直居中 */
    color: #bdc3c7; /* 菜单项文字颜色 */
    padding: 14px 20px; /* 调整内边距 */
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 1.1em; /* 菜单文字大小 */
}

.sidebar-menu a i {
    margin-right: 12px; /* 图标和文字之间的间距 */
    font-size: 1.3em; /* 图标大小 */
}

.sidebar-menu a:hover {
    background-color: #34495e; /* 鼠标悬停时的背景颜色 */
    color: #ecf0f1; /* 鼠标悬停时的文字颜色 */
}

.sidebar-menu a.active {
    background-color: #007bff; /* 选中状态的背景颜色 */
    color: #fff; /* 选中状态的文字颜色 */
    font-weight: bold;
    border-left: 4px solid #fff; /* 左侧加粗边框 */
    padding-left: 16px; /* 调整内边距以适应边框 */
}

/* Main Content Area */
.main-content {
    margin-left: 220px; /* 与左侧导航栏宽度一致 */
    padding: 20px;
    flex-grow: 1; /* 让主内容区域占据剩余宽度 */
}

/* Overall Layout using Flexbox on body */
body {
    display: flex; /* 在 body 上使用 flex 布局 */
    min-height: 100vh; /* 最小高度为视口高度 */
}

/* Adjust container behavior within main-content */
.main-content .container {
    max-width: 1200px;
    margin: 0 auto; /* 居中 */
    padding: 0 15px; /* 左右内边距 */
    width: 100%; /* 确保容器宽度 */
}


.page-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #343a40;
    font-size: 2em; /* 页面标题字体大小 */
    border-bottom: 1px solid #eee; /* 页面标题下划线 */
    padding-bottom: 10px;
}

/* Card Styles (for course list) */
.course-grid {
    display: grid; /* 使用 grid 布局 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 自动填充，最小宽度 280px */
    gap: 20px; /* 卡片之间的间距 */
}

.course-card {
    border: none; /* 移除边框 */
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 更明显的阴影 */
    padding: 20px;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    display: flex; /* 使用 flex 布局 */
    flex-direction: column; /* 垂直排列 */
    justify-content: space-between; /* 内容分散对齐 */
}

.course-card:hover {
    transform: translateY(-5px); /* 鼠标悬停时上移 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* 鼠标悬停时更明显的阴影 */
}

.course-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.course-card p {
    color: #555;
    font-size: 1em;
    margin-bottom: 8px;
}

.course-card .instructor-info {
    font-style: normal;
    color: #777;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.card-actions {
    margin-top: auto; /* 将操作按钮推到底部 */
    padding-top: 10px; /* 操作按钮区域顶部内边距 */
    border-top: 1px solid #eee; /* 操作按钮区域顶部边框 */
}

.card-actions a,
.card-actions button {
    /* 调整按钮样式 */
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn {
    /* 通用按钮样式 */
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #545b62;
    border-color: #545b62;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #c82333;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-actions {
    margin-top: 1.5rem;
}

.form-actions button,
.form-actions a {
    margin-right: 0.5rem;
}

/* Alert Messages */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Login Page Specific Styles */
.login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f7f9; /* Consistent background */
}

.login-form-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px; /* 限制登录表单最大宽度 */
}

.login-form-card h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #343a40;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Optional: Add some basic styles for icons if you use a library like Font Awesome */
/* Make sure to include the Font Awesome CSS library in your HTML files' <head> */
/*
.fa {
    margin-right: 8px;
}
*/

